
package com.example.widgettest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends Activity
{
    private ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        listView = new ListView(this);
        listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, demoListNames));
        listView.setOnItemClickListener(new OnItemClickListener()
        {
            public void onItemClick(AdapterView<?> arg0, View arg1, int id, long arg3)
            {
                Intent intent = new Intent(MainActivity.this,demoListActivities[id]);
                MainActivity.this.startActivity(intent);
            }
        });

        setContentView(listView);
    }

    
    @SuppressWarnings("rawtypes")
    private final Class[] demoListActivities = {
        PathMenuActivity.class,
        CalendarActivity.class,
        WheelViewActivity.class,
        SliderActivity.class,
        TouchImageActivity.class
        
    };
    private final String[] demoListNames = {
        "PATH Menu view",
        "Calendar view",
        "Wheel View",
        "Slider View",
        "Touch Image View"
    };
}
